/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1551518434441_1453';

  // add your middleware config here
  config.middleware = [];
  config.security = {
    csrf:false,
    //设置跨域白名单，允许从哪个域过来的跨域请求
    domainWhiteList:[
      'http://127.0.0.1:8000'
    ]
  }
  //配置跨域 插件，允许客户端跨域的时候发送cookie
  config.cors = {
    credentials:true
  }
  // add your user config here
  const userConfig = {
    mysql:{
      client:{
        host:'localhost',
        port:3306,
        user:'root',
        password:'root',
        database:'cms'
      }
    }
  };
  userConfig.jwtSecret='zhufengjiagou';//jwt的秘钥
  return {
    ...config,
    ...userConfig,
  };
};
